﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GreateTool
{
    public partial class FileOnlyNameForm : Form
    {
        public FileOnlyNameForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var arr = new string[richTextBox1.Lines.Length];

            var index = 0;

            foreach (var str in richTextBox1.Lines)
            {
                arr[index++] = checkBox1.Checked ? System.IO.Path.GetFileNameWithoutExtension(str) : System.IO.Path.GetFileName(str);
            }

            richTextBox1.Lines = arr;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Clipboard.SetText(richTextBox1.Text);
        }
    }
}
